<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>留言板 - 林小雨的个人空间</title>
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
  
  <style>
    :root {
      --primary: #4A6FFF;
      --primary-light: #E8F0FF;
      --success: #34C759;
      --text-primary: #1D2129;
      --text-secondary: #86909C;
      --border-light: #E5E6EB;
      --bg-white: #FFFFFF;
      --bg-light: #F2F3F5;
      --gray-100: #F7F8FA;
    }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      background-color: var(--bg-light);
      color: var(--text-primary);
      font-size: 15px;
      line-height: 1.6;
      padding-bottom: 80px;
    }
    
    /* 顶部导航 */
    .page-header {
      background-color: var(--bg-white);
      padding: 15px 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid var(--border-light);
      position: sticky;
      top: 0;
      z-index: 100;
    }
    
    .header-title {
      font-size: 18px;
      font-weight: 600;
    }
    
    .header-btn {
      color: var(--primary);
      font-size: 16px;
      background: none;
      border: none;
      padding: 5px 10px;
      font-weight: 500;
    }
    
    .back-btn {
      color: var(--text-primary);
      font-size: 20px;
      text-decoration: none;
    }
    
    /* 留言输入区 */
    .message-input-container {
      background-color: var(--bg-white);
      padding: 12px 16px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .input-wrapper {
      display: flex;
      gap: 10px;
    }
    
    .user-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      object-fit: cover;
    }
    
    .message-input {
      flex: 1;
      background-color: var(--gray-100);
      border: 1px solid var(--border-light);
      border-radius: 20px;
      padding: 10px 15px;
      font-size: 14px;
      resize: none;
      height: 42px;
      overflow: hidden;
    }
    
    .message-input:focus {
      outline: none;
      border-color: var(--primary);
      background-color: white;
    }
    
    .send-btn {
      width: 42px;
      height: 42px;
      border-radius: 50%;
      background-color: var(--primary);
      color: white;
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    
    /* 留言列表 */
    .message-list {
      padding: 10px 0;
    }
    
    .message-item {
      padding: 12px 16px;
      background-color: var(--bg-white);
      border-bottom: 1px solid var(--border-light);
    }
    
    .message-header {
      display: flex;
      justify-content: space-between;
      margin-bottom: 8px;
    }
    
    .sender-info {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    
    .sender-avatar {
      width: 45px;
      height: 45px;
      border-radius: 50%;
      object-fit: cover;
    }
    
    .sender-name {
      font-weight: 500;
    }
    
    .is-following {
      font-size: 12px;
      color: var(--primary);
      background-color: var(--primary-light);
      padding: 1px 8px;
      border-radius: 10px;
      margin-left: 5px;
    }
    
    .message-time {
      color: var(--text-secondary);
      font-size: 12px;
      display: flex;
      align-items: flex-end;
    }
    
    .message-content {
      margin-bottom: 10px;
      line-height: 1.6;
    }
    
    .message-actions {
      display: flex;
      gap: 15px;
      font-size: 13px;
      color: var(--text-secondary);
    }
    
    .message-action {
      display: flex;
      align-items: center;
      gap: 5px;
      cursor: pointer;
    }
    
    .message-action:hover {
      color: var(--primary);
    }
    
    /* 回复区域 */
    .reply-container {
      background-color: var(--gray-100);
      border-radius: 8px;
      padding: 10px;
      margin-top: 10px;
    }
    
    .reply-header {
      display: flex;
      align-items: center;
      margin-bottom: 5px;
    }
    
    .owner-avatar {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      object-fit: cover;
      margin-right: 8px;
    }
    
    .owner-name {
      font-weight: 500;
      font-size: 14px;
    }
    
    .is-owner {
      font-size: 11px;
      color: white;
      background-color: var(--primary);
      padding: 0 5px;
      border-radius: 4px;
      margin-left: 5px;
    }
    
    .reply-content {
      font-size: 14px;
      margin-bottom: 5px;
      padding-left: 38px;
    }
    
    .reply-time {
      font-size: 12px;
      color: var(--text-secondary);
      padding-left: 38px;
    }
    
    /* 更多回复 */
    .more-replies {
      color: var(--primary);
      font-size: 13px;
      margin-top: 8px;
      cursor: pointer;
      display: inline-block;
    }
    
    /* 空状态 */
    .empty-state {
      padding: 60px 20px;
      text-align: center;
    }
    
    .empty-icon {
      font-size: 50px;
      color: var(--border-light);
      margin-bottom: 15px;
    }
    
    .empty-text {
      color: var(--text-secondary);
      font-size: 16px;
    }
    
    .empty-subtext {
      color: var(--text-secondary);
      font-size: 14px;
      margin-top: 5px;
    }
    
    /* 底部导航 */
    .bottom-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background-color: var(--bg-white);
      border-top: 1px solid var(--border-light);
      display: flex;
      justify-content: space-around;
      padding: 8px 0;
      z-index: 100;
    }
    
    .nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      color: var(--text-secondary);
      text-decoration: none;
      font-size: 10px;
      flex: 1;
    }
    
    .nav-item.active {
      color: var(--primary);
    }
    
    .nav-icon {
      font-size: 20px;
      margin-bottom: 3px;
    }
  </style>
</head>
<body>
  <!-- 顶部导航 -->
  <div class="page-header">
    <a href="#" class="back-btn">
      <i class="fa fa-arrow-left"></i>
    </a>
    <div class="header-title">留言板</div>
    <button class="header-btn">
      <i class="fa fa-search"></i>
    </button>
  </div>
  
  <!-- 留言输入区 -->
  <div class="message-input-container">
    <div class="input-wrapper">
      <img src="https://picsum.photos/200/200?random=99" alt="你的头像" class="user-avatar">
      <textarea class="message-input" placeholder="写下你的留言..."></textarea>
      <button class="send-btn">
        <i class="fa fa-paper-plane"></i>
      </button>
    </div>
  </div>
  
  <!-- 留言列表 -->
  <div class="message-list">
    <!-- 留言1 -->
    <div class="message-item">
      <div class="message-header">
        <div class="sender-info">
          <img src="https://picsum.photos/200/200?random=10" alt="发送者头像" class="sender-avatar">
          <div>
            <span class="sender-name">张明</span>
            <span class="is-following">互相关注</span>
          </div>
        </div>
        <div class="message-time">3分钟前</div>
      </div>
      
      <div class="message-content">
        小雨你好！看了你的摄影作品真的很喜欢，尤其是那组城市夜景，构图和光影处理得太棒了，能请教一下拍摄技巧吗？
      </div>
      
      <div class="message-actions">
        <div class="message-action">
          <i class="fa fa-heart-o"></i>
          <span>12</span>
        </div>
        <div class="message-action">
          <i class="fa fa-reply"></i>
          <span>回复</span>
        </div>
      </div>
      
      <!-- 主人回复 -->
      <div class="reply-container">
        <div class="reply-header">
          <img src="https://picsum.photos/200/200?random=5" alt="主人头像" class="owner-avatar">
          <span class="owner-name">林小雨 <span class="is-owner">主人</span></span>
        </div>
        <div class="reply-content">
          谢谢你的喜欢！那组照片主要是用了长曝光，配合三脚架拍摄的，后期稍微调整了对比度和饱和度。如果你有具体问题可以再问我哦~
        </div>
        <div class="reply-time">1分钟前</div>
      </div>
    </div>
    
    <!-- 留言2 -->
    <div class="message-item">
      <div class="message-header">
        <div class="sender-info">
          <img src="https://picsum.photos/200/200?random=11" alt="发送者头像" class="sender-avatar">
          <div>
            <span class="sender-name">李华</span>
          </div>
        </div>
        <div class="message-time">昨天 18:45</div>
      </div>
      
      <div class="message-content">
        请问你上周分享的那组旅行照片是在哪里拍的？风景太美了，计划下个月去旅行，想参考一下你的目的地~
      </div>
      
      <div class="message-actions">
        <div class="message-action">
          <i class="fa fa-heart-o"></i>
          <span>8</span>
        </div>
        <div class="message-action">
          <i class="fa fa-reply"></i>
          <span>回复</span>
        </div>
      </div>
      
      <!-- 主人回复 -->
      <div class="reply-container">
        <div class="reply-header">
          <img src="https://picsum.photos/200/200?random=5" alt="主人头像" class="owner-avatar">
          <span class="owner-name">林小雨 <span class="is-owner">主人</span></span>
        </div>
        <div class="reply-content">
          那是在云南大理拍的，推荐你4-5月去，气候特别舒服，花海也很漂亮~ 具体地点我标记在最后一张照片的定位里了哦
        </div>
        <div class="reply-time">昨天 19:20</div>
      </div>
      
      <!-- 访客回复 -->
      <div class="reply-container">
        <div class="reply-header">
          <img src="https://picsum.photos/200/200?random=11" alt="访客头像" class="owner-avatar">
          <span class="owner-name">李华</span>
        </div>
        <div class="reply-content">
          太感谢了！已经看到定位了，正好下个月有假期，准备安排去那里~
        </div>
        <div class="reply-time">昨天 20:05</div>
      </div>
      
      <div class="more-replies">查看全部3条回复</div>
    </div>
    
    <!-- 留言3 -->
    <div class="message-item">
      <div class="message-header">
        <div class="sender-info">
          <img src="https://picsum.photos/200/200?random=12" alt="发送者头像" class="sender-avatar">
          <div>
            <span class="sender-name">王芳</span>
            <span class="is-following">已关注</span>
          </div>
        </div>
        <div class="message-time">3天前</div>
      </div>
      
      <div class="message-content">
        喜欢你分享的生活态度，每次看你的动态都觉得很治愈。最近也想开始学习摄影，能推荐一款适合新手的相机吗？预算大概5000左右~
      </div>
      
      <div class="message-actions">
        <div class="message-action">
          <i class="fa fa-heart"></i>
          <span>36</span>
        </div>
        <div class="message-action">
          <i class="fa fa-reply"></i>
          <span>回复</span>
        </div>
      </div>
      
      <!-- 主人回复 -->
      <div class="reply-container">
        <div class="reply-header">
          <img src="https://picsum.photos/200/200?random=5" alt="主人头像" class="owner-avatar">
          <span class="owner-name">林小雨 <span class="is-owner">主人</span></span>
        </div>
        <div class="reply-content">
          谢谢你的认可~ 5000左右预算推荐索尼ZV-1或者佳能M50 Mark II，都是很适合新手的微单，对焦快而且直出色彩好，轻便易携适合日常记录
        </div>
        <div class="reply-time">3天前</div>
      </div>
    </div>
    
    <!-- 留言4 -->
    <div class="message-item">
      <div class="message-header">
        <div class="sender-info">
          <img src="https://picsum.photos/200/200?random=13" alt="发送者头像" class="sender-avatar">
          <div>
            <span class="sender-name">赵伟</span>
          </div>
        </div>
        <div class="message-time">1周前</div>
      </div>
      
      <div class="message-content">
        摄影技术真的很棒！我是一家咖啡馆的店主，最近想给店铺拍一组宣传照，不知道你有没有时间接商业拍摄？可以私信聊一下吗？
      </div>
      
      <div class="message-actions">
        <div class="message-action">
          <i class="fa fa-heart-o"></i>
          <span>5</span>
        </div>
        <div class="message-action">
          <i class="fa fa-reply"></i>
          <span>回复</span>
        </div>
      </div>
    </div>
  </div>
  
  <!-- 底部导航 -->
  <div class="bottom-nav">
    <a href="#" class="nav-item">
      <i class="fa fa-home nav-icon"></i>
      <span>首页</span>
    </a>
    <a href="#" class="nav-item">
      <i class="fa fa-compass nav-icon"></i>
      <span>发现</span>
    </a>
    <a href="#" class="nav-item">
      <i class="fa fa-plus-circle nav-icon" style="font-size: 1.8rem; margin-top: -0.3rem;"></i>
    </a>
    <a href="#" class="nav-item">
      <i class="fa fa-envelope-o nav-icon"></i>
      <span>消息</span>
    </a>
    <a href="#" class="nav-item active">
      <i class="fa fa-user nav-icon"></i>
      <span>我的</span>
    </a>
  </div>
  
  <!-- Bootstrap JS -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  
  <script>
    // 留言输入框自动调整高度
    const textarea = document.querySelector('.message-input');
    textarea.addEventListener('input', function() {
      this.style.height = 'auto';
      // 限制最大高度为120px
      if (this.scrollHeight <= 120) {
        this.style.height = this.scrollHeight + 'px';
      } else {
        this.style.height = '120px';
        this.style.overflowY = 'auto';
      }
    });
    
    // 发送留言
    document.querySelector('.send-btn').addEventListener('click', function() {
      const message = textarea.value.trim();
      if (message) {
        // 模拟发送成功
        alert('留言发送成功！');
        textarea.value = '';
        textarea.style.height = '42px';
        textarea.style.overflowY = 'hidden';
        
        // 这里可以添加动态添加新留言到列表的逻辑
      } else {
        alert('请输入留言内容');
      }
    });
    
    // 点赞功能
    document.querySelectorAll('.message-action .fa-heart-o').forEach(icon => {
      icon.addEventListener('click', function(e) {
        e.stopPropagation();
        this.classList.remove('fa-heart-o');
        this.classList.add('fa-heart');
        this.style.color = '#FF5252';
        
        // 更新点赞数
        const countElem = this.nextElementSibling;
        countElem.textContent = parseInt(countElem.textContent) + 1;
      });
    });
    
    // 已点赞取消
    document.querySelectorAll('.message-action .fa-heart').forEach(icon => {
      icon.addEventListener('click', function(e) {
        e.stopPropagation();
        this.classList.remove('fa-heart');
        this.classList.add('fa-heart-o');
        this.style.color = '';
        
        // 更新点赞数
        const countElem = this.nextElementSibling;
        countElem.textContent = parseInt(countElem.textContent) - 1;
      });
    });
    
    // 回复功能
    document.querySelectorAll('.message-action .fa-reply').forEach(icon => {
      icon.parentElement.addEventListener('click', function(e) {
        e.stopPropagation();
        const senderName = this.closest('.message-item').querySelector('.sender-name').textContent;
        textarea.value = `回复 @${senderName}：`;
        textarea.focus();
        // 触发input事件以调整高度
        const event = new Event('input', { bubbles: true });
        textarea.dispatchEvent(event);
        // 滚动到输入框
        textarea.scrollIntoView({ behavior: 'smooth' });
      });
    });
    
    // 查看更多回复
    document.querySelector('.more-replies').addEventListener('click', function() {
      this.textContent = '收起回复';
      // 这里可以添加显示更多回复的逻辑
    });
    
    // 返回按钮
    document.querySelector('.back-btn').addEventListener('click', function() {
      history.back();
    });
    
    // 搜索按钮
    document.querySelector('.header-btn').addEventListener('click', function() {
      alert('搜索留言');
    });
    
    // 底部导航交互
    document.querySelectorAll('.nav-item').forEach(item => {
      if (!item.querySelector('.fa-plus-circle')) {
        item.addEventListener('click', function(e) {
          e.preventDefault();
          document.querySelectorAll('.nav-item').forEach(nav => {
            nav.classList.remove('active');
          });
          this.classList.add('active');
        });
      }
    });
    
    // 发布按钮
    document.querySelector('.nav-item .fa-plus-circle').parentElement.addEventListener('click', function(e) {
      e.preventDefault();
      alert('打开发布内容选项');
    });
  </script>
</body>
</html>
